<?php
/*
*	Kleophatra - Open Source Content Management System
*	------------------------------------------------------------------------
*	Copyright (C) 2007-2010, Sergio Milardovich <smilardovich@yahoo.com.ar>
*	This program is Free Software.
*	KleoGD - Implementation of phpthumb class.
*
*	@package	Kleophatra
*	@subpackage	/lib
*	@license	http://www.gnu.org/copyleft/gpl.html GNU/GPL License 2.0
*	@author		Sergio Milardovich <smilardovich@yahoo.com.ar>
*	@link		http://www.kleophatra.org
*/
class kleogd extends kleocore{

	function thumblr_static($source,$width,$height,$output,$zoom=2,$quality=75){
		$buff;

		require_once(KLEO_LIB_DIR.'third_party/phpthumb/phpthumb.class.php');

		// Create phpThumb object
		$phpThumb = new phpThumb();
		// Clean the shit
		$phpThumb->resetObject();
		// Set parameters...
		$phpThumb->setSourceFilename($source);
		$phpThumb->setParameter('w', $width);
		$phpThumb->setParameter('h', $height);
		$phpThumb->setParameter('zc', $zoom);
		$phpThumb->setParameter('q', $quality);
		$phpThumb->setParameter('config_output_format', 'jpeg');

		// Render!
		if($phpThumb->GenerateThumbnail()):
			$phpThumb->RenderToFile($output);
		else:
			return false;
		endif;

	}

}
